package d4_bufferstream;

import java.io.*;

public class t1byte {
    public static void main(String[] args) {
    //1.创建输入输出流
        try(
                InputStream isr = new FileInputStream("D:\\mycode\\file10\\src\\111");
                InputStream bis = new BufferedInputStream(isr);

                OutputStream osw = new FileOutputStream("D:\\mycode\\file10\\src\\234");
                OutputStream baos = new BufferedOutputStream(osw);
        ) {
            byte[] buffer = new byte[1024];
            int len;
            while((len=bis.read(buffer))>0){
                baos.write(buffer,0,len);
            }
            System.out.println("finish");

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
